package com.ziroom.zifamily.zfcensor.resources;

import com.ziroom.zifamily.zfcensor.mq.RocketProviderClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>测试类</p>
 * <p>
 * <PRE>
 * <BR>    修改记录
 * <BR>-----------------------------------------------
 * <BR>    修改日期         修改人          修改内容
 * </PRE>
 *
 * @author cuiyh9
 * @version 1.0
 * @Date Created in 2018年11月24日 16:09
 * @since 1.0
 */
@RestController
@Api(value = "/首页", description = "首页")
public class IndexResource {

    @Autowired
    private RocketProviderClient rocketProviderClient;

    @ApiOperation(value = "首页", notes = "首页", response = String.class)
    @GetMapping("/")
    public String index() {
        rocketProviderClient.sendMsgByTopic(RocketProviderClient.TOPIC_CENSOR_FEED, "Hello World");
        return "Hello World";
    }
}
